package edu.sctu.zcy.month201505.day20150528;

/**
 * Created by user24 on 2015/5/28.
 */
public class TextString {
    //    equals
//            length
//    substring
//            charAt
//    indexOf
//            lastIndexOf
//    replace
//            split
//    toLowerCase
//            toUpperCase
//    toString
//    trim()
//    valueOf

    public boolean equalsDemo(String string){
        if(string.equals("zcyc")){
            return true;
        }else {

            return false;
        }
    }

    public int lengthDemo(String string){

        return string.length();
    }

    public String subStringDemo(String string){

       String string1 = string.substring(0, 2);
        return string1;
    }

    public char charAtDemo(String string){

        char s = string.charAt(2);
        return s;
    }

    public int indexOfDemo(String string){

       int c = string.indexOf('c');
        return c;
    }

    public int lastIndexOfDemo(String string){

        int c = string.lastIndexOf('c');
        return c;
    }

    public String replaceDemo(String string){

       String s = string.replace('c', 'w');
        return s;
    }

    public String toLowerCaseDemo(String string){
        String s = string.toUpperCase();
        return s;
    }

    public String  valueOfDemo(String string){
        String s = string.valueOf(6);
        return s;
    }

    public String  trimDemo(String string){
        String s = string.trim();
        return s;
    }


}
